<!DOCTYPE html>
<html lang="en">
<head>
    {# 加载Django的static模板标签，允许在模板中引入静态资源 #}
    {% load static %}
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/main.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'layui/css/layui.css' %}">
    <script type="application/javascript" src="{% static 'layui/layui.js' %}"></script>
</head>
<body>
    <div class="header">
        <div class="headerLayout w1200">
            <div class="headerCon">
                <h1 class="mallLogo">
                    {# 第一个index代表mybabys文件中的urls.py中定义的路由命名控件namespace #}
                    {# 第二个index代表项目引用index的urls.py中定义的路由的命名name #}
                    <a href="{% url 'index:index' %}" title="母婴商城">
                        <img src="{% static 'img/logo.png' %}" alt="">
                    </a>
                </h1>
                <div class="mallSearch">
                    {# 访问地址暂时设置为首页，访问地址应该设置为商品列表 #}
                    <form action="{% url 'commodity:commodity' %}" method="get" class="layui-form" novalidate>
                        <label>
                            <input type="text" name="n" required lay-verify="required" autocomplete="off"
                                   class="layui-input" placeholder="请输入需要的商品">
                        </label>
                        <button class="layui-btn" lay-submit lay-fliter="formDemo">
                            <i class="layui-icon layui-icon-search"></i>
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>

    {# 导航栏 #}
    <div class="content content-nav-base {{ classContent }}">
        <div class="main-nav">
            <div class="inner-cont0">
                <div class="inner-cont1 w1200">
                    <div class="inner-cont2">
                        <a href="{% url 'index:index' %}" {% if classContent == '' %}class="active"{% endif %}>
                        首页
                        </a>
                        <a href="{% url 'commodity:commodity' %}" {% if classContent == 'commodity-content' %}class="active"{% endif %}>
                        所有商品
                        </a>
                        <a href="{% url 'shopper:shopcart' %}" {% if classContent == 'shopcarts' %}class="active"{% endif %}>
                        购物车
                        </a>
                        <a href="{% url 'shopper:shopper' %}" {% if classContent == 'infomations' %}class="active"{% endif %}>
                        个人中心
                        </a>
                    </div>
                </div>
            </div>
        </div>
        {# 使用Django内置模板语法block设置文件调用入口 #}
        {% block content %}{% endblock content %}
    </div>
    {% block footer %}{% endblock footer %}
    <script type="text/javascript">
        {% block script %}{% endblock script %}
    </script>
</body>
</html>